package com.wiscamp.ninechapters.problems.adapter;

import cube.ddd.adapter.RestResponse;
import cube.ddd.aspect.HandleResourceException;
import cube.ddd.utils.ResourceUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.ws.rs.core.Context;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
@Tag(name = "题库-API版本信息")
public class VersionController {

    @GetMapping("Version")
    @Operation(summary = "获取API版本号")
    @HandleResourceException
    public RestResponse<String> getApiVersion(@Context HttpServletRequest request, @Context HttpServletResponse response) {
        var version = "v230930.1";
        return ResourceUtils.getOkResponse(request, response, version);
    }
}
